package com.woniuxy.carrental.service.impl;

import com.woniuxy.carrental.entity.CarOrder;
import com.woniuxy.carrental.mapper.CarOrderMapper;
import com.woniuxy.carrental.service.CarOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CarOrderImpl implements CarOrderService {
    @Resource
    CarOrderMapper carOrderMapper;

    @Override
    public List<CarOrder> findAllCarOrder(CarOrder carOrder, Integer pageIndex, Integer pageSize) {
        return carOrderMapper.selectAllCarOrder(carOrder, pageIndex, pageSize);
    }

    @Override
    public int findCountCarOrder(String order_status) {
        return carOrderMapper.selectCountCarOrder(order_status);
    }

    @Override
    public void removeCarOrder(String order_id) {
        carOrderMapper.deleteCarOrder(order_id);
    }

    @Override
    public List<CarOrder> findallDateExpend() {
        List<CarOrder> list = carOrderMapper.findallDateExpend();
        return list;
    }

    @Override
    public void addCarOrder(CarOrder carOrder) {
        carOrderMapper.insertCarOrder(carOrder);
    }
}
